package deng.camel.beans.processors;

import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.Processor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class ExchangeLogger implements Processor {

	private static Log logger = LogFactory.getLog(ExchangeLogger.class);

	@Override
	public void process(Exchange exchange) throws Exception {
		Message msg = exchange.getIn();
		logger.debug("Exchange properties=" + exchange.getProperties());
		logger.info("Exchange id=" + exchange.getExchangeId() + ", in=" + msg + ", in.headers=" + msg.getHeaders());
	}
	
}
